/*
 * XML Type:  EEnumLiteral
 * Namespace: http://www.eclipse.org/emf/2002/Ecore
 * Java type: org.eclipse.emf.x2002.ecore.EEnumLiteral
 *
 * Automatically generated - do not modify.
 */
package org.eclipse.emf.x2002.ecore.impl;
/**
 * An XML EEnumLiteral(@http://www.eclipse.org/emf/2002/Ecore).
 *
 * This is a complex type.
 */
public class EEnumLiteralImpl extends org.eclipse.emf.x2002.ecore.impl.ENamedElementImpl implements org.eclipse.emf.x2002.ecore.EEnumLiteral
{
    private static final long serialVersionUID = 1L;
    
    public EEnumLiteralImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName VALUE$0 = 
        new javax.xml.namespace.QName("", "value");
    private static final javax.xml.namespace.QName INSTANCE$2 = 
        new javax.xml.namespace.QName("", "instance");
    private static final javax.xml.namespace.QName LITERAL$4 = 
        new javax.xml.namespace.QName("", "literal");
    
    
    /**
     * Gets the "value" attribute
     */
    public int getValue()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(VALUE$0);
            if (target == null)
            {
                return 0;
            }
            return target.getIntValue();
        }
    }
    
    /**
     * Gets (as xml) the "value" attribute
     */
    public org.eclipse.emf.x2002.ecore.EInt xgetValue()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EInt target = null;
            target = (org.eclipse.emf.x2002.ecore.EInt)get_store().find_attribute_user(VALUE$0);
            return target;
        }
    }
    
    /**
     * True if has "value" attribute
     */
    public boolean isSetValue()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(VALUE$0) != null;
        }
    }
    
    /**
     * Sets the "value" attribute
     */
    public void setValue(int value)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(VALUE$0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(VALUE$0);
            }
            target.setIntValue(value);
        }
    }
    
    /**
     * Sets (as xml) the "value" attribute
     */
    public void xsetValue(org.eclipse.emf.x2002.ecore.EInt value)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EInt target = null;
            target = (org.eclipse.emf.x2002.ecore.EInt)get_store().find_attribute_user(VALUE$0);
            if (target == null)
            {
                target = (org.eclipse.emf.x2002.ecore.EInt)get_store().add_attribute_user(VALUE$0);
            }
            target.set(value);
        }
    }
    
    /**
     * Unsets the "value" attribute
     */
    public void unsetValue()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(VALUE$0);
        }
    }
    
    /**
     * Gets the "instance" attribute
     */
    public java.lang.String getInstance()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(INSTANCE$2);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "instance" attribute
     */
    public org.eclipse.emf.x2002.ecore.EEnumerator xgetInstance()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EEnumerator target = null;
            target = (org.eclipse.emf.x2002.ecore.EEnumerator)get_store().find_attribute_user(INSTANCE$2);
            return target;
        }
    }
    
    /**
     * True if has "instance" attribute
     */
    public boolean isSetInstance()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(INSTANCE$2) != null;
        }
    }
    
    /**
     * Sets the "instance" attribute
     */
    public void setInstance(java.lang.String instance)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(INSTANCE$2);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(INSTANCE$2);
            }
            target.setStringValue(instance);
        }
    }
    
    /**
     * Sets (as xml) the "instance" attribute
     */
    public void xsetInstance(org.eclipse.emf.x2002.ecore.EEnumerator instance)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EEnumerator target = null;
            target = (org.eclipse.emf.x2002.ecore.EEnumerator)get_store().find_attribute_user(INSTANCE$2);
            if (target == null)
            {
                target = (org.eclipse.emf.x2002.ecore.EEnumerator)get_store().add_attribute_user(INSTANCE$2);
            }
            target.set(instance);
        }
    }
    
    /**
     * Unsets the "instance" attribute
     */
    public void unsetInstance()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(INSTANCE$2);
        }
    }
    
    /**
     * Gets the "literal" attribute
     */
    public java.lang.String getLiteral()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(LITERAL$4);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "literal" attribute
     */
    public org.eclipse.emf.x2002.ecore.EString xgetLiteral()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EString target = null;
            target = (org.eclipse.emf.x2002.ecore.EString)get_store().find_attribute_user(LITERAL$4);
            return target;
        }
    }
    
    /**
     * True if has "literal" attribute
     */
    public boolean isSetLiteral()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(LITERAL$4) != null;
        }
    }
    
    /**
     * Sets the "literal" attribute
     */
    public void setLiteral(java.lang.String literal)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(LITERAL$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(LITERAL$4);
            }
            target.setStringValue(literal);
        }
    }
    
    /**
     * Sets (as xml) the "literal" attribute
     */
    public void xsetLiteral(org.eclipse.emf.x2002.ecore.EString literal)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EString target = null;
            target = (org.eclipse.emf.x2002.ecore.EString)get_store().find_attribute_user(LITERAL$4);
            if (target == null)
            {
                target = (org.eclipse.emf.x2002.ecore.EString)get_store().add_attribute_user(LITERAL$4);
            }
            target.set(literal);
        }
    }
    
    /**
     * Unsets the "literal" attribute
     */
    public void unsetLiteral()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(LITERAL$4);
        }
    }
}
